//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.me.details;

import java.io.Serializable;

public class DetailsList
        implements Serializable {

    public DetailsList() {
    }

    public DetailsList(Integer id, String name, String category, String updateUserId, String updateTime) {
        setId(id);
        setName(name);
        setCategory(category);
        setUpdateUserId(updateUserId);
        setUpdateTime(updateTime);
    }

    public DetailsList(DetailsList otherData) {
        setId(otherData.getId());
        setName(otherData.getName());
        setCategory(otherData.getCategory());
        setUpdateUserId(otherData.getUpdateUserId());
        setUpdateTime(otherData.getUpdateTime());
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getCategory() {
        return category;
    }

    public void setUpdateUserId(String updateUserId) {
        this.updateUserId = updateUserId;
    }

    public String getUpdateUserId() {
        return updateUserId;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public String toString() {
        StringBuffer str = new StringBuffer("{");
        str.append("id=" + getId() + " " + "name=" + getName() + " " + "category=" + getCategory() + " " + "updateUserId=" + getUpdateUserId() + " " + "updateTime=" + getUpdateTime());
        str.append('}');
        return str.toString();
    }

    public boolean equals(Object pOther) {
        if (pOther instanceof DetailsList) {
            DetailsList lTest = (DetailsList) pOther;
            boolean lEquals = true;
            if (id == null) {
                lEquals = lEquals && lTest.id == null;
            } else {
                lEquals = lEquals && id.equals(lTest.id);
            }
            if (name == null) {
                lEquals = lEquals && lTest.name == null;
            } else {
                lEquals = lEquals && name.equals(lTest.name);
            }
            if (category == null) {
                lEquals = lEquals && lTest.category == null;
            } else {
                lEquals = lEquals && category.equals(lTest.category);
            }
            if (updateUserId == null) {
                lEquals = lEquals && lTest.updateUserId == null;
            } else {
                lEquals = lEquals && updateUserId.equals(lTest.updateUserId);
            }
            if (updateTime == null) {
                lEquals = lEquals && lTest.updateTime == null;
            } else {
                lEquals = lEquals && updateTime.equals(lTest.updateTime);
            }
            return lEquals;
        } else {
            return false;
        }
    }

    public int hashCode() {
        int result = 17;
        result = 37 * result + (id == null ? 0 : id.hashCode());
        result = 37 * result + (name == null ? 0 : name.hashCode());
        result = 37 * result + (category == null ? 0 : category.hashCode());
        result = 37 * result + (updateUserId == null ? 0 : updateUserId.hashCode());
        result = 37 * result + (updateTime == null ? 0 : updateTime.hashCode());
        return result;
    }
    private Integer id;
    private String name;
    private String category;
    private String updateUserId;
    private String updateTime;
}
